package com.ruoyi.generator.util;

import java.util.Collection;
import java.util.Map;

/**
 * @Classname SimpleCollUtil
 * @Description 集合工具类
 * @Date 2025/11/21 14:57
 * @Created by 陈九常
 */
public final class SimpleCollUtil {

    private SimpleCollUtil() { /* no instance */ }

    // Collection
    public static boolean isEmpty(Collection<?> coll) {
        return coll == null || coll.isEmpty();
    }

    public static boolean isNotEmpty(Collection<?> coll) {
        return !isEmpty(coll);
    }

    // Map
    public static boolean isEmpty(Map<?, ?> map) {
        return map == null || map.isEmpty();
    }

    public static boolean isNotEmpty(Map<?, ?> map) {
        return !isEmpty(map);
    }

    // Array (Object[])
    public static boolean isEmpty(Object[] array) {
        return array == null || array.length == 0;
    }

    public static boolean isNotEmpty(Object[] array) {
        return !isEmpty(array);
    }

    public static boolean isNull(Object o) {
        return o == null;
    }

    public static boolean isNotNull(Object o) {
        return o != null;
    }
}